/*
  MinCC - Minimalist Compiler Collection
  Copyright (C) 2009 Scott Lawrence

  MinCC is free software: you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  MinCC is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
  License for more details.

  You should have received a copy of the GNU General Public License
  along with mincc.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CODEHANDLER_HPP
#define CODEHANDLER_HPP

#include "codeLoader.hpp"

//ADT
class CodeHandler {
public:
    //should only do minimal preparation
    CodeHandler();  
    virtual ~CodeHandler();

    //actually prepare the codehandler
    virtual int load()=0;

    virtual int handle(char *code,CodeLoader *loader)=0;

    //not to be overriden
    int init();    
    CodeLoader *getLoader();
    void setLoader(CodeLoader *);
protected:
    CodeLoader *loader;
private:
};

void initCodeHandlers();

#endif
